#include <QApplication>
#include <QDateTime>
#include <QDebug>
#include <QElapsedTimer>
#include <httpclient.h>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QElapsedTimer timer;
    timer.restart();

    Response resp = HttpClient::instance().get("https://cpu.bmcx.com/web_system/bmcx_com_www/system/file/cpu/get_data/?lx=cpu&s=1&e=999999");
    qDebug() << resp.toList().count();

    qDebug() << timer.elapsed() << "(ms)";

    timer.restart();

    foreach (auto var, resp.toList()) {
        auto map = var.toMap();

        auto id = map.value("id").toString();
        auto pai_ming = map.value("pai_ming").toInt();
        auto ming_cheng = map.value("ming_cheng").toString();
        auto shu_zhi = map.value("shu_zhi").toString();
        auto bai_fen_bi = map.value("bai_fen_bi").toDouble();

        qDebug() << id << ming_cheng << shu_zhi << bai_fen_bi;
    }
    qDebug() << timer.elapsed() << "(ms)";

    return 0;
}
